<template>
  <div>
    <!--模糊查询-->
    <el-form
      :inline="true"
      :model="formInli" status-icon
      :rules="rules" ref="formInline"
      class="demo-form-inline"
      style="text-align: left">
      <el-form-item label="菜单名称" prop="phone">
        <el-input v-model="formInli.phone" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="getdata()">查询</el-button>
        <el-button icon="el-icon-refresh" @click="resetForm('formInli')">重置</el-button>
        <el-button
          type="primary"
          icon="el-icon-circle-plus-outline"
          @click="dialogVisible=true">添加
        </el-button>
      </el-form-item>
    </el-form>

    <!--用户表格-->
    <el-table
      :data="formInline"
      border
      style="width: 1300px;height: 100%">
      <el-table-column
        prop="id"
        label="序号"
        width="50">
      </el-table-column>
      <el-table-column
        prop="phone"
        label="菜单名称"
        width="220">
      </el-table-column>
      <el-table-column
        prop="name"
        label="路由地址"
        width="170">
      </el-table-column>
      <el-table-column
        prop="sort"
        label="接口地址"
        width="300">
      </el-table-column>
      <el-table-column
        prop="state"
        label="类型"
        width="140">
      </el-table-column>
      <el-table-column
        prop="text"
        label="备注"
        width="150">
      </el-table-column>

      <el-table-column label="操作" width="220">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.row.id)">删除
          </el-button>
          <el-button
            size="mini"
            type="success"
            @click="handleEdit(scope.row,1)">修改
          </el-button>
          <el-button
            size="mini"
            type="primary"
            @click="handleEdit(scope.row,2)">设置角色
          </el-button>
          <el-button
            size="mini"
            type="success"
            @click="handleEdit(scope.row,3)">密码修改
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <!--分页-->
    <div class="block" style="text-align: right">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="formInli.current"
        :page-sizes="[2, 4, 20, 50, 100, 200, 500, 1000]"
        :page-size="formInli.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        formInli: {
          id: '',
          name: '',
          phone: '',
          adminRoleId: '',
          sort: '',
          state: '',
          text: '',
          passworld: '',
          current: 1,
          size: 2,
        },
      }
    },

  }
</script>

<style scoped>

</style>
